package org.demo.mysql.schema.controller;

import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
import org.demo.mysql.schema.model.SchemaInfo;
import org.demo.mysql.schema.service.SchemaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Title: SchemaController
 * @Description: []
 * @Author lei.cheng
 * @Date 2024/8/19
 */
@Controller
@RequestMapping("/mysql")
public class SchemaController {

    @Autowired
    private SchemaService schemaService;

    @ResponseExcel(name ="数据字典", writeHandler = { ExcelCellWidthStyleStrategy.class })
    @GetMapping("/schema")
    public List<SchemaInfo> get() {
        return schemaService.gets();
    }
}
